//
//  TSYHomeViewController.swift
//  TSYWeiBoDemo
//
//  Created by apple on 2016/11/23.
//  Copyright © 2016年 apple. All rights reserved.
//

import UIKit
import pop

private let cellId = "cellID"

class TSYHomeViewController: TSYBaseViewController {
    
    private lazy var statusList = [String]()
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        tableView?.register(UINib(nibName: "TSYStatusNormalCell", bundle: nil), forCellReuseIdentifier: "cellId")
    }
    
    override func loadDate() {
        //网络加载
        let url = "https://api.weibo.com/2/statuses/home_timeline.json"
        let param = ["access_token":"2.004ICIuC0t6_y8c31b4dedb8l85z5E"]
        
        
        
        for i in 0..<10{
            statusList.insert(i.description, at: 0)
        }
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    @objc func showMy(){
        
        print(#function)
    }
   
    func popAnimatal(){
        
        let i = 8
        
        let a:POPSpringAnimation = POPSpringAnimation(propertyNamed: kPOPLayerScaleY)//缩放
        
        a.fromValue = 300
        a.toValue = 500
        
        //弹力系数 取值范围 0～20 数值越大，弹力越大
        a.springBounciness = 8
        a.springSpeed = 8
        
        a.beginTime = CACurrentMediaTime()+CFTimeInterval(i)+0.35
        
        view.pop_add(a, forKey: nil)
    }
}

extension TSYHomeViewController{
    
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 0
    }
    
    override func numberOfSections(in tableView: UITableView) -> Int {
        return 0
    }
    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        return UITableViewCell()
    }
}

extension TSYHomeViewController{
    
    override func setupUI() {
        super.setupUI()
        
        navItem.leftBarButtonItem = UIBarButtonItem(title: "哈哈", target: self, action: #selector(showMy))
        
        tableView?.register(UITableViewCell.self, forCellReuseIdentifier: cellId)
    }
    
}
